package Control;

import javax.swing.*;
import Database.*;
import java.awt.*;
import java.awt.event.*;


public class SalesReturnGUI extends JFrame implements ActionListener
{
        private JLabel jlID, jlQty, jlPrice, jlTotal;
        private JTextField jtID, jtQty, jtPrice, jtTotal;
        private JButton refund, cancel;
        private JPanel p1, p2;
        private TableOperations to;

        public SalesReturnGUI()
        {
                setTitle("MDL - Sales Return");
        setSize(300, 400);
        setLocationRelativeTo(null);
        setResizable(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new GridLayout(2,1));
        
        //Panel 1
        p1 = new JPanel();
        p1.setLayout(new GridLayout(4,2));
        add(p1);
        
        jlID = new JLabel("ID");
        p1.add(jlID);
        
        jtID = new JTextField("");
        p1.add(jtID);
        
        jlQty = new JLabel("Quantity");
        p1.add(jlQty);
        
        jtQty = new JTextField("");
        p1.add(jtQty);
        
        jlPrice = new JLabel("Price");
        p1.add(jlPrice);
        
        jtPrice = new JTextField("");
        p1.add(jtPrice);
        
        jlTotal = new JLabel("Total");
        p1.add(jlTotal);
        
        jtTotal = new JTextField("");
        p1.add(jtTotal);
        
        //Panel 2
        p2 = new JPanel(new FlowLayout());
        add(p2);
        
        refund = new JButton("Refund");
        p2.add(refund);
        
        cancel = new JButton("Cancel");
        p2.add(cancel);
        }


        public void actionPerformed(ActionEvent e) 
        {
                if(e.getSource() == cancel)
                {
                        this.dispose();
                }
        }
        
        public static void main(String[] args) 
        {
                SalesReturnGUI s = new SalesReturnGUI();
                s.setVisible(true);
                
        }

}